﻿using HandyControl.Controls;
using HandyControl.Tools;
using System.Windows;

namespace LpbPrj.Client.Controls;

public class ImageUriPropertyEditor : PropertyEditorBase
{
    public override FrameworkElement CreateElement(PropertyItem propertyItem)
    {
        var imageSelector = new ImageUriSelectorEx
        {
            IsEnabled = !propertyItem.IsReadOnly,
            Width = 50,
            Height = 50,
            HorizontalAlignment = HorizontalAlignment.Left,
            Style = ResourceHelper.GetResource<System.Windows.Style>("ImageSelectorDefaultStyle"),
        };

        return imageSelector;
    }

    public override DependencyProperty GetDependencyProperty() => ImageUriSelectorEx.UriExProperty;
}
